package com.wl156.model;

import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

public class Certificate implements KvmSerializable {

	public String userLoginId;
	public String userPassword;
	public String certifcateToken;
	public String type;

	public Certificate() {
	}

	public Certificate(String userLoginId, String certifcateToken) {
		this.userLoginId = userLoginId;
		this.userPassword = "";
		this.certifcateToken = certifcateToken;
	}

	public Certificate(String userLoginId, String certifcateToken, String type) {
		this(userLoginId, certifcateToken);
		this.type = type;
	}

	@Override
	public Object getProperty(int index) {
		switch (index) {
		case 0:
			return this.userLoginId;
		case 1:
			return this.userPassword;
		case 2:
			return this.certifcateToken;
		}

		return null;
	}

	@Override
	public int getPropertyCount() {
		return 3;
	}

	@Override
	public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo info) {
		switch (index) {
		case 0:
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "UserLoginId";
			break;
		case 1:
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "UserPassword";
			break;
		case 2:
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "CertifcateToken";
			break;
		}
	}

	@Override
	public void setProperty(int index, Object value) {
		switch (index) {
		case 0:
			this.userLoginId = value.toString();
			break;
		case 1:
			this.userPassword = value.toString();
			break;
		case 2:
			this.certifcateToken = value.toString();
			break;
		}
	}

}
